<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>

	<%
		String url = request.getParameter("url");
		int total = Integer.parseInt(request.getParameter("items"));
	%>
	<style>
		.pager-span{ display:inline-block;}
		.pager-span a{ display:inline-block; padding:5px 15px; border:1px solid #ccc; text-decoration:none; color:#000;}
		font{ padding:5px 15px; background-color:#1E9FFF; color:#FFF;}
		.pager-span a:hover{ color:#009688;}
	</style>
<div class="pager">
	<pg:pager url="<%=url%>" items="<%=total%>" maxPageItems="15" maxIndexPages="10" export="currentPageNumber=pageNumber">
		<span class="pager-span">
			<pg:first>
				<a href="${pageUrl}">首页</a>
			</pg:first>
		</span>
		<span class="pager-span">
			<pg:prev>
				<a href="${pageUrl}">上一页</a>
			</pg:prev>
		</span>
			<pg:pages>
				<span class="pager-span">
					<c:choose>
						<c:when test="${currentPageNumber eq pageNumber}">
							<font>${pageNumber}</font>
						</c:when>
						<c:otherwise>
							<a href="${pageUrl}">${pageNumber}</a>
						</c:otherwise>
					</c:choose>
				</span>
			</pg:pages>
		<span class="pager-span">
			<pg:next>
				<a href="${pageUrl}">下一页</a>
			</pg:next>
		</span>
		<span class="pager-span">
			<pg:last>
				<a href="${pageUrl}">最后一页</a>
			</pg:last>
		</span>
	</pg:pager>
</div>